/**
 * 
 */
package com.longrise.android.loaddata;

import java.util.HashMap;
import java.util.Map;

/**
 * 存储文件缓存大小的值
 *
 * <p>detailed comment
 * @author call 2016-2-15
 * @see
 * @since 1.0
 */
public class LoaddataContainer
{
    private static LoaddataContainer mLoaddataContainer = null;
    
    private static Map<String, Integer> mMap = new HashMap<String, Integer>();
    
    private LoaddataContainer(){
        
    }
    
    public static LoaddataContainer getInstance(){
        if(mLoaddataContainer == null){
            synchronized (LoaddataContainer.class)
            {
                if(mLoaddataContainer == null){
                    mLoaddataContainer = new LoaddataContainer();
                }
            }
        }
        return mLoaddataContainer;
    }
    
    public void putDownedFileLength(String path,int downedFileLength){
        mMap.put(path, downedFileLength);
    }
    
    public int getDownedFileLength(String path){
        
        if(mMap.containsKey(path)){
            return mMap.get(path);
        }else{
            return 0;
        }
        
    }
}
